# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=pciutils
pkgver=3.12.0
pkgrel=0
pkgdesc="PCI bus configuration space access library and tools"
url="http://mj.ucw.cz/pciutils.html"
arch="all"
license="GPL-2.0-only"
depends="hwdata-pci"
makedepends="linux-headers"
options="!check"
subpackages="$pkgname-doc $pkgname-dev $pkgname-libs"
source="$pkgname-$pkgver.tar.gz::https://github.com/pciutils/pciutils/archive/refs/tags/v$pkgver.tar.gz
	"

build() {
	make OPT="$CFLAGS -fPIC -flto=auto" ZLIB=no \
		SHARED=yes \
		PREFIX=/usr \
		SHAREDIR=/usr/share/hwdata \
		MANDIR=/usr/share/man \
		all
}

package() {
	make PREFIX="$pkgdir"/usr \
		SHARED=yes \
		SHAREDIR="$pkgdir"/usr/share/hwdata \
		MANDIR="$pkgdir"/usr/share/man \
		install install-lib

	# this is now supplied by the hwids package
	rm -rf "$pkgdir"/usr/sbin/update-pciids
	rm -rf "$pkgdir"/usr/share/man/man8/update-pciids.8
	rm -rf "$pkgdir"/usr/share/hwdata
}

sha512sums="
2157cda808acd685b985bd8b8e63bd868a042c6316859bb5bfd08f6de52172570dd6780fb3390a5abbf3b4c16d7e4bec05b4034caeee28b5a11cb3a8efc299ce  pciutils-3.12.0.tar.gz
"
